<?php

namespace api\modules\app\models;

use Yii;

/**
 * This is the model class for table "unit_view".
 *
 * @property integer $id
 * @property string $date
 * @property string $district_code
 * @property string $street_code
 * @property string $grid_code
 * @property integer $total
 * @property integer $bind
 * @property integer $bad
 */
class UnitView extends \api\modules\app\models\BaseModel
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'unit_view';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('test_3');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['date', 'district_code', 'street_code', 'grid_code'], 'required'],
            [['total', 'bind', 'bad'], 'integer'],
            [['date', 'district_code', 'street_code', 'grid_code'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'date' => 'Date',
            'district_code' => 'District Code',
            'street_code' => 'Street Code',
            'grid_code' => 'Grid Code',
            'total' => 'Total',
            'bind' => 'Bind',
            'bad' => 'Bad',
        ];
    }
}
